package com.smarth.zhizulian.http.inter;


import com.smarth.zhizulian.bean.BaseEntity;
import com.smarth.zhizulian.bean.Category;
import com.smarth.zhizulian.bean.Disciple;
import com.smarth.zhizulian.bean.News;
import com.smarth.zhizulian.bean.Page;
import com.smarth.zhizulian.bean.Test;
import com.smarth.zhizulian.bean.activity.ActivityShare;
import com.smarth.zhizulian.bean.activity.ActivityStatus;
import com.smarth.zhizulian.bean.article.ArticleShare;
import com.smarth.zhizulian.bean.cash.CashIsFirstCash;
import com.smarth.zhizulian.bean.collection.CollectionIndex;
import com.smarth.zhizulian.bean.disciple.DiscipleDisNum;
import com.smarth.zhizulian.bean.login.Login;
import com.smarth.zhizulian.bean.lucky.LuckyFriends;
import com.smarth.zhizulian.bean.lucky.LuckyInfo;
import com.smarth.zhizulian.bean.lucky.LuckyMyFriendLucky;
import com.smarth.zhizulian.bean.lucky.LuckyOpenFriendLucky;
import com.smarth.zhizulian.bean.lucky.LuckyShareIncome;
import com.smarth.zhizulian.bean.message.MessageAppMessage;
import com.smarth.zhizulian.bean.message.MessageAppNews;
import com.smarth.zhizulian.bean.message.MessageAppNoticePage;
import com.smarth.zhizulian.bean.message.MessageUserMessage;
import com.smarth.zhizulian.bean.profit.ProfitCashApply;
import com.smarth.zhizulian.bean.profit.ProfitProfit;
import com.smarth.zhizulian.bean.profit.ProfitUserProfit;
import com.smarth.zhizulian.bean.task.TaskUserTasks;
import com.smarth.zhizulian.bean.user.DiscipleIndex;
import com.smarth.zhizulian.bean.user.MineIndex;
import com.smarth.zhizulian.bean.user.MineUserInfo;
import com.smarth.zhizulian.bean.video.VideoShare;
import com.smarth.zhizulian.bean.video.VideoVideoTexts;

import java.util.List;
import java.util.Map;

import io.reactivex.Observable;
import okhttp3.ResponseBody;
import retrofit2.http.Field;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Url;

/**
 * Created by KUMA on 2017/10/8.
 */

public interface RetrofitService {
    //    @FormUrlEncoded
//    @POST("account/login")
//    Observable<BaseEntity<String>> login(
//            @Field("userId") String userId,
//            @Field("password") String password
//    );
//
//    @GET("video/getUrl")
//    Observable<BaseEntity<String>> getVideoUrl(
//            @Query("id") long id
//    );
//
//    @FormUrlEncoded
//    @POST("user/addVideo")
//    Observable<BaseEntity<String>> addVideo(
//            @FieldMap Map<String, Object> map
//    );
//
//    //获取豆瓣Top250 榜单
//    @Headers("Cache-Control : public, max-age = 3600")
//    @GET("top250")
//    Observable<MovieSubject> getTop250(@Query("start") int start, @Query("count") int count);
    @GET("http://baike.baidu.com/api/openapi/BaikeLemmaCardApi?scope=103&format=json&appid=379020&bk_key=关键字&bk_length=600")
    Observable<Test> test();

//    @GET("/maicai/app/api/v1/article/channels")
//    Observable<List<Category>> articleChanels(
//    );

    @POST("article/articleTypes")
    Observable<BaseEntity<List<Category>>> articleArticleTypes(
    );

    @POST("video/videoTypes")
    Observable<BaseEntity<List<Category>>> videoVideoTypes(
    );

    //查询视频列表
    @FormUrlEncoded
    @POST("video/videoTexts")
    Observable<BaseEntity<Page<VideoVideoTexts>>> videoVideoTexts(
            @Field("channelId") String channelId, @Field("page") int page
    );

    //查询视频列表
    @FormUrlEncoded
    @POST("video/page")
    Observable<BaseEntity<Page<VideoVideoTexts>>> videoReVideoTexts(
            @Field("channelId") String channelId, @Field("random") int randomCoin, @Field("page") int page
    );

//    @FormUrlEncoded
//    @POST("/maicai/app/api/v1/sms")
//    Observable<ResponseBody> sms(@Field("mobile") String mobile
//    );

    @FormUrlEncoded
    @POST("login")
    Observable<BaseEntity<Login>> login(
            @Field("phone") String phone
            , @Field("smsCode") String smsCode
            , @Field("deviceId") String deviceId
            , @Field("channelCode") String channelCode
    );

    @FormUrlEncoded
    @POST("disciple/page")
    Observable<BaseEntity<Page<Disciple>>> disciplePage(
            @Field("page") int page
    );

    @POST("disciple/index")
    Observable<BaseEntity<DiscipleIndex>> discipleIndex(
    );

    @POST("mine/index")
    Observable<BaseEntity<MineIndex>> mineIndex(
    );

    @POST("mine/userInfo")
    Observable<BaseEntity<MineUserInfo>> mineUserInfo(
    );

//    @GET("/maicai/app/api/v1/article/texts/{category}")
//    Observable<List<News>> articleTexts(@Path("category") String category, @Query("page") int page);

    //查询文章列表（新）
    @FormUrlEncoded
    @POST("article/articleTexts")
    Observable<BaseEntity<Page<News>>> articleArticleTexts(@Field("channelId") String channelId, @Field("page") int page);

    //文章搜索接口
    @FormUrlEncoded
    @POST("article/searchPage")
    Observable<BaseEntity<Page<News>>> articleSearchPage(@Field("searchText") String searchText, @Field("page") int page);

    //徒弟总数接口
    @POST("disciple/disNum")
    Observable<BaseEntity<DiscipleDisNum>> discipleDisNum();

    //视频搜索接口
    @FormUrlEncoded
    @POST("video/searchPage")
    Observable<BaseEntity<Page<VideoVideoTexts>>> videoSearchPage(@Field("searchText") String searchText, @Field("page") int page);

    //查询文章列表（新5）
    @FormUrlEncoded
    @POST("article/page")
    Observable<BaseEntity<Page<News>>> articleReArticleTexts(@Field("channelId") String channelId, @Field("random") int randomCoin, @Field("page") int page);

    //修改个人基本信息
    @FormUrlEncoded
    @POST("mine/editUserInfo")
    Observable<BaseEntity<Object>> mineEditUserInfo(
            @FieldMap Map<String, Object> map
    );

    //APP端签到接口
    @POST("task/sign")
    Observable<BaseEntity<Long>> taskSign(
    );

    @FormUrlEncoded
    @POST("profit/profitPage")
    Observable<BaseEntity<Page<ProfitProfit>>> profitProfitPage(@Field("page") int page);

    @FormUrlEncoded
    @POST("profit/cashApplyPage")
    Observable<BaseEntity<Page<ProfitCashApply>>> profitCashApplyPage(@Field("page") int page);

    @POST("profit/userProfit")
    Observable<BaseEntity<ProfitUserProfit>> profitUserProfit();

    //获取七牛授权
    @POST("qiniu/getToken")
    Observable<BaseEntity<String>> qiniuGetToken();

    @POST("task/userTasks")
    Observable<BaseEntity<TaskUserTasks>> taskUserTasks();

    @POST("message/appMessage")
    Observable<BaseEntity<MessageAppMessage>> messageAppMessage();

    @POST("message/userMessage")
    Observable<BaseEntity<MessageUserMessage>> messageUserMessage();

    @POST("cash/isFirstCash")
    Observable<BaseEntity<CashIsFirstCash>> cashIsFirstCash();
//
//    //用户提现
//    @FormUrlEncoded
//    @POST("/maicai/app/api/v1/user/cashapply")
//    Observable<OldSuccess> userCashApply(
//            @Field("type") String type
//            , @Field("money") String money
//    );

    //用户提现
    @FormUrlEncoded
    @POST("cash/cashApply")
    Observable<BaseEntity<Object>> userCashApply(
            @Field("name") String name
            , @Field("money") String money
    );

    @GET
    Observable<ResponseBody> downloadFile(@Url String url);

    @FormUrlEncoded
    @POST("article/share")
    Observable<BaseEntity<ArticleShare>> articleShare(@Field("relationId") String relationId);

    @FormUrlEncoded
    @POST("video/share")
    Observable<BaseEntity<VideoShare>> videoShare(@Field("relationId") String relationId);

    //任务完成接口
    @FormUrlEncoded
    @POST("task/finishTask")
    Observable<BaseEntity<Long>> taskFinishTask(
            @Field("type") String type
    );

    //用户文章分享回掉
    @FormUrlEncoded
    @POST("task/finishShareTask")
    Observable<BaseEntity<Object>> taskFinishShareTask(
            @Field("relationId") String relationId
    );

    //发送短信验证码（新）
    @FormUrlEncoded
    @POST("login/sendValidateCode")
    Observable<BaseEntity<Object>> loginSendValidateCode(
            @Field("mobile") String mobile
    );

    @POST("activity/status")
    Observable<BaseEntity<ActivityStatus>> activityStatus(
    );

    @POST("activity/share")
    Observable<BaseEntity<ActivityShare>> activityShare(
    );

    @POST("lucky/info")
    Observable<BaseEntity<LuckyInfo>> luckyInfo(
    );

    @FormUrlEncoded
    @POST("lucky/openPackEnd")
    Observable<BaseEntity<Integer>> luckyOpenPackEnd(
            @Field("num") int num
    );

    @POST("lucky/openPack")
    Observable<BaseEntity<Integer>> luckyOpenPack(
    );

    @POST("lucky/shareIncome")
    Observable<BaseEntity<LuckyShareIncome>> luckyShareIncome(
    );

    @POST("lucky/myFriendLucky")
    Observable<BaseEntity<List<LuckyMyFriendLucky>>> luckyMyFriendLucky(
    );

    @POST("lucky/reback")
    Observable<BaseEntity> luckyReback(
    );

    @FormUrlEncoded
    @POST("lucky/friends")
    Observable<BaseEntity<Page<LuckyFriends>>> luckyFriends(
            @Field("page") int page
    );

    @FormUrlEncoded
    @POST("lucky/openFriendLucky")
    Observable<BaseEntity> luckyOpenFriendLucky(
            @Field("friendId") long friendId
    );

    @FormUrlEncoded
    @POST("lucky/reBackFriend")
    Observable<BaseEntity> luckyReBackFriend(
            @Field("id") long id
    );

    @FormUrlEncoded
    @POST("collection/index")
    Observable<BaseEntity<Page<CollectionIndex>>> collectionIndex(
            @Field("type") int type
            , @Field("page") int page
    );

    @FormUrlEncoded
    @POST("collection/deleteColletion")
    Observable<BaseEntity> collectionDeleteColletion(
            @Field("ids") String ids
            , @Field("type") int type
    );

    @FormUrlEncoded
    @POST("message/appNews")
    Observable<BaseEntity<Page<MessageAppNews>>> messageAppNews(
            @Field("page") int page
    );

    @FormUrlEncoded
    @POST("message/appNoticePage")
    Observable<BaseEntity<Page<MessageAppNoticePage>>> messageAppNoticePage(
            @Field("page") int page
    );

    @POST("message/cleanNews")
    Observable<BaseEntity> messageCleanNews(
    );


//    //加密接口
//    @FormUrlEncoded
//    @POST("f")
//    Observable<BaseEntity<Object>> f(
//            @Field("mobile") String mobile
//    );

}
